<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        var a = Number(prompt('请输出1-3的数'))
        switch (a) {
            case 1:
                alert('输入的值为1')
                break
            case 2:
                alert('输入的值为2')
                break
            case 3:
                alert('输入的值为3')
                break
            default:
            alert('请输入正确的值')    
        }
    </script>
</body>

</html>